package Learn;

import ClassTest.Student;

import java.util.Objects;

public class ObjectsDemo1 {
    //对象工具类
    //提供了一些操作对象的方法
    public static void main(String[] args) {
        Student s1=new Student("zhangsan");
        Student s2=null;

        //先判空 在判等
        boolean result= Objects.equals(s1,s2);
        System.out.println(result);

        System.out.println(Objects.isNull(s1));
        System.out.println(Objects.isNull(s2));
        System.out.println(Objects.nonNull(s1));
        System.out.println(Objects.nonNull(s1));


    }


}
